import App from "./App";

// #ifndef VUE3
import Vue from "vue";
import "./uni.promisify.adaptor";
Vue.config.productionTip = false;
App.mpType = "app";
const app = new Vue({
  ...App,
});
app.$mount();
// #endif

// #ifdef VUE3
import { createSSRApp } from "vue";
import store from "./store/index";
import uViewPlus from "@/uni_modules/uview-plus";
import httpInterceptor from "./utils/http/config.request";
import temp from "./components/common/wakin-list-temp/index";
import { commonMixin } from "./mixins/mixCommon";
import mitt from "mitt";
import { jumpPage } from "./utils/route/route";
import PopupLogin from "./components/PopupLogin.vue";

export function createApp() {
  const app = createSSRApp(App);
  app.config.globalProperties.$Bus = mitt();
  app.config.globalProperties.$jump = jumpPage;
  app.use(store);
  app.use(uViewPlus);
  app.use(httpInterceptor);
  app.use(temp);
  app.mixin(commonMixin);
  app.component("PopupLogin", PopupLogin);
  return {
    app,
  };
}
// #endif
